# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import smart_str, smart_unicode
from apps.post.models import Post

class Comment(models.Model):
    content = models.TextField('回复',) 
    quoteid = models.IntegerField('引用id', default=0)
    quote = models.TextField('引用id',)

    author = models.ForeignKey(User)
    
    post = models.ForeignKey(Post)

    createdtime = models.DateTimeField(auto_now_add = True, db_index=True)   #auto_now_add = True, 
    
    class Meta:
        ordering = ['-createdtime']
        
    def __unicode__(self):   
        return smart_unicode(self.content)
    